import axios from 'axios'

const httpInstance = axios.create({
  baseURL: 'http://pcapi-xiaotuxian-front-devtest.itheima.net',
  timeout: 10000
})
//拦截器
//axios请求拦截器
httpInstance.interceptors.request.use(config => {  
  return config
}, error => {
  return Promise.reject(error)
})

//axios响应拦截器
httpInstance.interceptors.response.use(response => {
  return response.data
}, error => {
  return Promise.reject(error)
})

export default httpInstance